import request from '@/utils/request'

// 查询收货地址管理列表
export function appGetListByUserId(query) {
  return request({
    url: '/blind/address/appGetListByUserId',
    method: 'get',
    params: query
  })
}
// 奖品订单绑定地址
export function bindingAddress(orerId,addressId) {
  return request({
    url: '/client/order/bindingAddress/'+orerId+'/'+addressId,
    method: 'get',
  })
}
// 查询收货地址管理列表
export function listByUserId() {
  return request({
    url: '/client/address/listByUserId',
    method: 'get',
  })
}
// 查询商品
export function goodsList() {
  return request({
    url: '/client/goods/list/1/10',
    method: 'get',
  })
}
// 查询商品详情
export function goodsDetail(id) {
  return request({
    url: '/client/goods/detail/'+id,
    method: 'get',
  })
}
// 拍下商品
export function placeAnOrder(query) {
  return request({
    url: '/client/order/placeAnOrder',
    method: 'POST',
	params: query
  })
}
// 奖池列表查询
export function jackpotList(query) {
  return request({
    url: '/client/jackpot/list',
    method: 'get',
	params: query
  })
}

// 查单接口
export function checkOrderStatus(id) {
  return request({
    url: '/client/order//checkOrderStatus/'+id,
    method: 'get'
  })
}
// 拍下商品
export function wxPay(id) {
  return request({
    url: '/client/order/wxPay/'+id,
    method: 'get'
  })
}
// 首页轮播图
export function bannerShow() {
  return request({
    url: '/client/banner/show',
    method: 'get'
  })
}
// 奖池详情 允许匿名访问
export function jackpotDetail(id) {
  return request({
    url: '/client/jackpot/detail/'+id,
    method: 'get'
  })
}
// 奖池抽奖
export function lottery(id) {
  return request({
    url: '/client/jackpot/lottery/'+id,
    method: 'get'
  })
} 
// 添加地址
export function addressadd(query) {
  return request({
    url: '/client/address/add',
    method: 'put',
    params: query
  })
}
// 删除地址
export function deleteAddress(id) {
  return request({
    url: '/client/address/delete/'+id,
    method: 'get'
  })
}

// 修改地址
export function appEditByUuid(query) {
  return request({
    url: '/blind/address/appEditByUuid',
    method: 'post',
    data: query
  })
}
// 获取地址详情
// export function detailByAddressId(id) {
//   return request({
//     url: '/client/address/detailByAddressId/'+id,
//     method: 'get'
//   })
// }
// 获取地址详情
export function detailByAddressId(query) {
  return request({
    url: '/client/address/detailByAddressId/'+query,
    method: 'get'
  })
}
// 地址修改
export function updateAddress(query) {
  return request({
    url: '/client/address/update',
    method: 'put',
	data: query
  })
}

// 设为默认地址
export function appMakeDefault(query) {
  return request({
    url: '/blind/address/appMakeDefault',
    method: 'post',
    data: query
  })
}